<template>
    <div>
      
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media" v-for="item in newsList" :key="item.id">
                <router-link :to="'/home/newsinfo/'+item.id">
                    <img class="mui-media-object mui-pull-left" :src="item.img">
                    <div class="mui-media-body">
                        <h1>{{item.news}}</h1>
                        <p class='mui-ellipsis'>
                            <span>发表时间：{{item.n_time}}</span>
                            <span>点击：{{item.count}}次</span>
                        </p>
                    </div>
                </router-link>
            </li>
        </ul>
    </div>
</template>
<script >
export default{
    data(){
        return{
            newsList:[]
        }
    },
    created(){
        this.getNewsList()
    },
    methods:{
        getNewsList(){
            var self=this;
            $.ajax({
                url:"http://hd215.api.yesapi.cn/?service=App.Table.FreeQuery&model_name=news&logic=and&where=%5B%5B%22cat%22%2C+%22%3D%22%2C+%220%22%5D%5D&page=1&perpage=10&app_key=9701679D4CFB823670BA30DBEA0AE855&sign=8147016B39C556B9305531125BEE1316",
                type:"GET",
                dataType:"jsonp",
                success:function(res){
                   self.newsList=res.data.list;
                }
            })            
        }
    }
}
</script>
<style lang="scss" scoped>
.mui-table-view{
    li{
        h1{
            font-size: 14px;
        }
         .mui-ellipsis{
                font-size: 12px;
                color:#226aff;
                display: flex;
                justify-content: space-between;
         }
    }
} 
</style>
